#include "ByteBuffer.hh"

ByteBuffer::ByteBuffer(size_t s){
	ptr=new char[s];
	len=s;
}

ByteBuffer::ByteBuffer(char* p,size_t s){
	ptr=p;
	len=s;
}

ByteBuffer::~ByteBuffer(){
	if(ptr!=NULL) delete [] ptr;
}


ByteBuffer::ByteBuffer(){
	ByteBuffer((size_t)getpagesize());
}

size_t ByteBuffer::size(){
	return len;
}

char * ByteBuffer::getptr(){
	return ptr;
}

